#pragma once

#include <map>
#include <string>
#include "obj/glm.h"
#include "vector3d.h"

using namespace std;

#define ERROR_CODE_NONE 0
#define ERROR_CODE_MODEL_EXISTED 1
#define ERROR_CODE_FILE_NOT_FOUND 2
#define ERROR_CODE_MODEL_NOT_EXIST 3

class model_factory
{
	static model_factory* ms_singleton;
	map<string,GLMmodel*> model_map;
	int error_code;

public:
	model_factory(void);
	~model_factory(void);

	static model_factory& get_model_factory();
	bool load_model(string& filepath, string& name);
	bool unload_model(string& name);
	bool draw_model(string name, vector3d& position, vector3d& rotation, vector3d& scale,
		unsigned int draw_mode = GLM_TEXTURE);

};

